package cn.tedu.csmall.stock.webapi.util;

import cn.tedu.csmall.commons.pojo.stock.dto.StockReduceCountDTO;
import cn.tedu.csmall.commons.restful.JsonResult;
import cn.tedu.csmall.commons.restful.ResponseCode;
import com.alibaba.csp.sentinel.slots.block.BlockException;

//自定义的限流类
public class BlockErrorHandler {
    public static JsonResult blockError(StockReduceCountDTO stockReduceCountDTO,
                                 BlockException e){
        //处理 直接做一个响应
        return JsonResult.failed(ResponseCode.BAD_REQUEST,"限流了");
    }
}
